<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Page extends CI_Controller {
	public function index()
	{
		echo "page controller";
		//$this->load->view('welcome_message');
	}
	public function view($page="home")
	{
		$this->load->helper(array('url'));
		$this->load->model(array("member_model"));
		//$this->output->cache(1);

		if(!file_exists(VIEWPATH."/pages/".$page.".php"))
		{
			show_404("无法找到页面",true);
		}
		$data = array();
		$data['title'] = "视图拼接";
		$data['list'] = $this->member_model->get_members();
		$data['company'] = array();


		$this->load->view("templates/header",$data);
		$this->load->view("pages/".$page,$data);
		$this->load->view("templates/footer",$data);
	}
	public function minfo($id)
	{
		$this->load->helper(array('url'));
		$this->load->model(array("member_model"));
		//$this->output->cache(1);

		$data = array();
		$data['title'] = "用户详情";
		$data['info'] = $this->member_model->get_members(true);

		$this->load->view("templates/header",$data);
		$this->load->view("pages/minfo",$data);
		$this->load->view("templates/footer",$data);
	}
}
